#pragma once
#include "cfdGrid.h"
/**
 * \file
 * \ingroup Core
 * ---
 *	defines the class fdSolution( finite-diffrence solution)
 *
*/

/**
 * \ingroup Core
 * \brief Incline class for a finite difference solution of a pde
 * \author HapTork
*/
class fdSolution
{
public:
	int nt;
	char scheme[51];
	char name[41];
	cfdGrid uGrid;
	cfdGrid vGrid;
	
	/** one-variable pde, finite difference solution Constructor: Definition
	 * ---
	 * Constructs a fdsolution instance with one solution grid and given discretization details
	 * @param	nx	mesh points along x-axis
	 * @param	ny	mesh points along y-axis
	 * @param	nt	time steps in an steday eq. solution
	 * @param	scm	scheme used to find the solution
	 * @param	nam name for the solution
	 */

	fdSolution(int nx,int ny,char* scm,char* nam,int nt=0):uGrid(nx,ny),vGrid()
	{
		this->nt=nt;
		strcpy_s(scheme,50,scm);
		strcpy_s(name,40,nam);
	}

	/** two-variable pde, finite difference solution Constructor: Definition
	 * ---
	 * Constructs a fdsolution instance with two solution grids and given discretization details
	 * @param	v	passed to show its a two-variable solution, isn't used anywhere else.
	 * @param	nx	mesh points along x-axis
	 * @param	ny	mesh points along y-axis
	 * @param	nt	time steps in an steday eq. solution
	 * @param	scm	scheme used to find the solution
	 * @param	nam name for the solution
	 */
	fdSolution(bool v,int nx,int ny,char* scm,char* nam,int nt=0):uGrid(nx,ny),vGrid(nx,ny)
	{
		this->nt=nt;
		strcpy_s(scheme,50,scm);
		strcpy_s(name,40,nam);
	}
	fdSolution(){}
	~fdSolution(void)
	{
	}

	/** Comparison Operator Overload mehtod: Definition
	 * ---
	 * compares if two fdSolution for a particualr pde are logically same

	 * @param o fdSolution object compared
	 */
	bool operator==(fdSolution& o){
		if(o.uGrid.getX()!=uGrid.getX() || o.uGrid.getY()!=uGrid.getY() || o.nt != nt || scheme!=o.scheme)
			return false;
		return true;
	}
};

